﻿using AutoMapper;
using BCDto.Common.News.ContentCategory;
using BCDto.Common.News.NewsContent;
using BCDto.Common.News.NewsContentComment;
using BCEntity.Common.News.ContentCategory;
using BCEntity.Common.News.NewsContent;
using BCEntity.Common.News.NewsContentComment;
using System;
using System.Collections.Generic;
using System.Text;

namespace BCService.MapperProfiles.Common.News
{
    public class NewsProfile : Profile
    {
        public NewsProfile()
        {
            //内容分类
            CreateMap<ContentCategoryDto, ContentCategoryEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<ContentCategoryRequestDto, ContentCategoryEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<ContentCategoryEntity, ContentCategoryDto>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            //新闻内容
            CreateMap<NewsContentDto, NewsContentEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<NewsContentRequestDto, NewsContentViewDto>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<NewsContentRequestDto, NewsContentEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<NewsContentViewDto, NewsContentEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<NewsContentEntity, NewsContentDto>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<NewsContentEntity, NewsContentViewDto>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<NewsContentViewEntity, NewsContentViewDto>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            //新闻内容评论
            CreateMap<NewsContentCommentDto, NewsContentCommentEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<NewsContentCommentRequestDto, NewsContentCommentEntity>().IgnoreAllPropertiesWithAnInaccessibleSetter();
            CreateMap<NewsContentCommentEntity, NewsContentCommentDto>().IgnoreAllPropertiesWithAnInaccessibleSetter();
        }
    }
}
